package java_thinking.unit_13._13_5;

/**
 * @Description : String.format() 内部其实也是创建了一个Formatter对象，然后传入参数转给该Formatter
 * @author: cww
 * @DateTime: 2019-03-24 22:13
 */

public class DatabaseException extends Exception {
    public DatabaseException(int transactionId,int queryId,String message) {
        super(String.format("(t%d,q%d) %s",transactionId,queryId,message));
    }

    public static void main(String[] args) {
        try {
            throw new DatabaseException(3,7,"Write failed");
        } catch (DatabaseException e) {
            System.out.println(e);
        }
    }
}
